package JXY04;


/**
 * 使用线程方式一创建两个线程:分别输出1000次，你好和再见
 * @author Bonnie
 *
 */
public class Test01 {
    public static void main(String[] args) {
        Thread thread1 = new MyThread1();
        Thread thread2 = new MyThread2();
        thread1.start();
        thread2.start();

    }
}
class MyThread1 extends Thread{
    public MyThread1() {

    }
    public MyThread1(String name) {
        super(name);
    }
    public void run(){
        for(int i=0;i<1000;i++){
            System.out.println("你好");
        }
    }
}
class MyThread2 extends Thread{
    public MyThread2() {

    }
    public MyThread2(String name) {
        super(name);
    }
    public void run(){
        for(int i=0;i<1000;i++){
            System.out.println("再见");
        }
    }
}